<?php

/*
*###########################################################################################################################*
#															    															#
#															    															#
#    **  ** ****** ** **  **  ****** ** ***   ** ***   ****** ** **  **  ** **  ** ** **  **    ****   ** **  **  ******    #
#    **  ** ****** ********** ****** *******  *******  ****** ********** ** **  ** **********  ******  ********** ******    #
#    **  ** **  ** **  **  ** **     ***   ** **    ** **     **  **  **    **  ** **  **  ** ***   ** **  **  ** **        #
#    ****** **  ** **  **  ** ****** **   *** **   *** ****** **  **  ** ** **  ** **  **  ** **       **  **  ** ******    #
#    ****** **  ** **  **  ** ****** *******  *******  ****** **  **  ** ** **  ** **  **  ** **       **  **  ** ******    #
#    **  ** **  ** **  **  ** **     *****    ******   **     **  **  ** ** **  ** **  **  ** ***   ** **  **  **     **    #
#    **  ** ****** **  **  ** ****** **       **  ***  ****** **  **  ** ** ****** **  **  **  ******  **  **  ** ******    #
#    **  ** ****** **  **  ** ****** **       **   *** ****** **  **  ** **  ** ** **  **  **   ****   **  **  ** ******    #
#															    															#
#															    															#
#															    															#
#    2010 - 2011 © HomePremiumCMS made by HomePemium as PremiumEye & Security by HomePremium and Merijnz		    		#
#															    															#
#    Powered by PhoenixPHP 3.7.1 (build 138000)										    									#
#															    															#
#															    															#
#															    															#
*###########################################################################################################################*
*/

define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('../global.php');
define("THIS_SCRIPT", 'display');
$username = $core->EscapeString($_SESSION['username']);
$email = $core->EscapeString($_SESSION['account']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $sitename." - Forum"; ?></title>

<link type="text/css" rel="stylesheet" href="../Public/Styles/<?php echo $currentstyle ?>/CSS/main.css" />
</head>

<body>

<?php include("header.php"); ?>

<div class="mainBox">

	<?php include("navigation.php"); ?>

	<div class="mid" id="midcontent">
    
    	<div style="width: 930px; margin-left: 1px; float: left; margin-top:10px;">
        
        	<div id="forum_top"></div>
        
        	<div id="forum_middle">
            	
                <div style="margin-top: -14px;"></div>
                
                <?php 
				$query = mysql_query("SELECT * FROM forum_titles ORDER BY id");
				
				
				
				while($forum = mysql_fetch_array($query)){
				echo '
                 
            	<div id="forum_rounded_container">'.$forum['name'].'</div>
				
				';
				
				$queryf = mysql_query("SELECT * FROM forum WHERE forum_title = ".$forum['id']." ORDER BY id LIMIT 100");
				
				while($forumm = mysql_fetch_array($queryf)){
					
				$queryt = mysql_query("SELECT * FROM forum_threads WHERE forum_id = ".$forumm['id']."");
				$threads = mysql_num_rows($queryt);

				echo '
                
            	<div id="forum_items">
                
                	<div id="left">
                
                		<div id="title"><a href="threads.php?id='.$forumm['id'].'">'.stripslashes(html_entity_decode($forumm['name'])).'</a></div>
                    
                    	<div id="description">'.$forumm['description'].'</div>
                        
                    </div>
                    
                    <div id="right">
                        
                        <div id="line">
                        
                        	<div id="title">'.$lang['threads'].'</div>
                    
                    		<div id="description">'.$threads.'</div>
                        
                        </div>
                        
                    </div>
					
				</div>
					';
				}
				}
				?>
                
            </div>
            
            <div id="forum_bottom"></div>
        
        </div>
        
    </div>
    
    <?php include("../system/footer.php"); ?>
    
</div>
</body>
</html>